﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace M1Xonix
{
    /// <summary>
    /// Näitab mingit väga tõsise töötegemise pilti, et boss tööajal mängimise peale kurjaks ei saaks
    /// </summary>
    class BossScreen: GameScreen
    {
        private ContentManager _content;
        private Texture2D _background;
        private int _screenWidth;
        private int _screenHeight;

        public override void LoadContent()
        {
            _screenWidth = ScreenManager.GraphicsDevice.Viewport.Width;
            _screenHeight = ScreenManager.GraphicsDevice.Viewport.Height;

            _content = new ContentManager(ScreenManager.Game.Services, "Content");
            _background = _content.Load<Texture2D>("tc_000");
            MediaPlayer.Pause();
        }

        public override void UnloadContent()
        {
            _content.Unload();
        }

        public override void Draw(GameTime gameTime)
        {
            SpriteBatch sprites = ScreenManager.SpriteBatch;
            sprites.Begin();

            sprites.Draw(_background, new Rectangle(0, 0, _screenWidth,_screenHeight), Color.White);
            sprites.End();
        }

        public override void HandleInput(InputState input)
        {
            if (input == null)
                throw new ArgumentNullException("input");

            KeyboardState keys = input.CurrentKeyboardStates[(int)ControllingPlayer.Value];

            if (keys.IsKeyDown(Keys.Escape))
            {
                MediaPlayer.Resume();
                ExitScreen();
            }
        }
    }
}
